﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SEAM.Exception;
using SEAM.Data;
using SEAM.Test.Common;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnExecute_Click(object sender, EventArgs e)
    {
        DataTable dtResults = DataAccess.Query(tbSQL.Text, Database.ReadWrite, Mode.Local);

        PersonObject objPerson = dtResults.First<PersonObject>();
        PersonStruct structPerson = dtResults.First<PersonStruct>();
        EmployeeObject objEmployee = dtResults.First<EmployeeObject>();

        List<PersonObject> objPeople = dtResults.Cast<PersonObject>();
        List<PersonStruct> structPeople = dtResults.Cast<PersonStruct>();

        int total = DataAccess.Query("SELECT 10", Database.ReadWrite, Mode.Local).First<int>();
        int? total2 = DataAccess.Query("SELECT null", Database.ReadWrite, Mode.Local).First<int?>();
        int? total3 = DataAccess.Query("SELECT 100", Database.ReadWrite, Mode.Local).First<int?>();

        DateTime curDate = DataAccess.Query("SELECT GetDate()", Database.ReadWrite, Mode.Local).First<DateTime>();
        DateTime curDate2 = DataAccess.Query("SELECT null", Database.ReadWrite, Mode.Local).First<DateTime>();
    }
}

